//
//  ViewController.m
//  PichImageView
//
//  Created by APPLE on 17/1/16.
//  Copyright © 2017年 Gibson. All rights reserved.
//

#import "ViewController.h"
#import "ImageViewController.h"

@interface ViewController ()

@property (strong, nonatomic) UIButton *btnImage;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"图片编辑";
    [self initImageButton];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)initImageButton {
    self.btnImage = [[UIButton alloc] init];
    [self.btnImage setTitle: @"图片编辑" forState: UIControlStateNormal];
    [self.btnImage setTitleColor: [UIColor purpleColor] forState: UIControlStateNormal];
    [self.btnImage addTarget: self action: @selector(editImage:) forControlEvents: UIControlEventTouchUpInside];
    [self.view addSubview: self.btnImage];
    
    [self.btnImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(200, 44));
        make.center.mas_equalTo(self.view);
    }];
    
}

-(void)editImage:(UIButton *)btn {
    [self.navigationController pushViewController: [ImageViewController new] animated: YES];
}

@end
